package com.yaoli.hihocoder;
import java.util.*;

/**
 * https://hihocoder.com/problemset/problem/1558
 *
 */
public class Main1558{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        int N = 2;
        int K = 4;

        long begin = 1;

        for(int i = 1 ; i < N ;i++){
            begin = begin * 10;
        }

        long end = begin * 10 - 1;

        if(N == 1){
            for(int i = 1 ; i<=K ; i++){
                System.out.println(i);
            }
        }else{
            for(long i = begin ; i <= end ; ){
                char [] array = String.valueOf(i).toCharArray();
                boolean flag = true;
                for(int j = 1 ; j < array.length ; j++){
                    if(array[0] - 48 > K){
                        flag = false;
                        i = end + 1;
                        break;
                    }
                    if(array[j] - 48 > K ||
                            (array[j-1]-48)*(array[j]-48) >K ){

                        int total = 1;
                        for(int k = j ; k < array.length ; k++){
                            array[j] = '0';
                            total = total * 10;
                        }
                        i = Integer.valueOf(String.valueOf(array)) + total;
                        flag = false;
                        break;
                    }
                }
                if(flag == true){
                    System.out.println(i);
                    i++;
                }
            }
        }
    }


}